﻿using System;
using fastCSharp;

namespace diantou.web.exam
{
    /// <summary>
    /// 企业考试说明
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsPage = false)]
    partial class description : view<description>
    {
        /// <summary>
        /// 企业考试说明
        /// </summary>
        /// <returns>是否成功</returns>
        private bool loadView(int examId)
        {
            if (user != null && examUser.ExamId == examId)
            {
                if (examUser.IsRegister)
                {
                    if (examUser.ExamTime == fastCSharp.pub.MinTime || examUser.IsSubmit || examUser.SubmitTime <= date.NowSecond) return load(examId);
                    location(new diantou.dataModel.path.exam { Id = examId }.Problem);
                }
                else location(new diantou.dataModel.path.exam { Id = examId }.Setting);
                return false;
            }
            if (load(examId))
            {
                switch(exam.Type)
                {
                    case dataModel.exam.type.考生熟悉环境的测试赛:
                    case dataModel.exam.type.完成答卷后发简历的考试:
                    case dataModel.exam.type.预先注册的考试:
                        location(exam.Path.Register);
                        return false;
                }
                location(exam.Path.Index);
            }
            return false;
        }
    }
}
